\hypertarget{class_integration}{
\section{Integration Class Reference}
\label{class_integration}\index{Integration@{Integration}}
}


handles integration to find next position and velocity of particles  




{\ttfamily \#include $<$Integration.h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_integration_a952d2dc5cab80259492e5f17ef9422a5}{Integration} (const \hyperlink{_integration_8h_acfa28acdaa41352ffd89be690a20933d}{IntegrationType} \_\-integrationType, const ngl::Real \_\-timestep)
\begin{DoxyCompactList}\small\item\em ctor \end{DoxyCompactList}\item 
void \hyperlink{class_integration_abc488c4b587e1f5ef990092692af1b79}{integrateNext} (\hyperlink{class_particle}{Particle} \&io\_\-currentParticle)
\begin{DoxyCompactList}\small\item\em integrate next velocity and position of a particle \end{DoxyCompactList}\item 
\hyperlink{_integration_8h_acfa28acdaa41352ffd89be690a20933d}{IntegrationType} \hyperlink{class_integration_a40b1cb639b068c89db9646fb5022f966}{getIntegrationType} () const 
\begin{DoxyCompactList}\small\item\em get the integration method \end{DoxyCompactList}\item 
void \hyperlink{class_integration_aab0af151cb363f5a2f7453466619631d}{setIntegrationType} (const \hyperlink{_integration_8h_acfa28acdaa41352ffd89be690a20933d}{IntegrationType} \_\-v)
\begin{DoxyCompactList}\small\item\em sets the integration method \end{DoxyCompactList}\item 
void \hyperlink{class_integration_af4c8b19403365773f73c9326574ff3dd}{setIntegrationType} (const int \_\-v)
\begin{DoxyCompactList}\small\item\em set the integration method of the simulation \end{DoxyCompactList}\item 
ngl::Real \hyperlink{class_integration_a16c2c98401d18f3232a2d31df8cf8b62}{getTimestep} () const 
\begin{DoxyCompactList}\small\item\em get the timestep of the simulation \end{DoxyCompactList}\item 
void \hyperlink{class_integration_aa9a9fc72d614bdbbedef54353fc8f2fe}{setTimestep} (const ngl::Real \_\-v)
\begin{DoxyCompactList}\small\item\em set the timestep of the simulation \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{class_integration_a26c01fb79df301b5a4b337a0ffc038b6}{evaluateSemiImplicitEuler} (\hyperlink{class_particle}{Particle} \&io\_\-currentParticle)
\begin{DoxyCompactList}\small\item\em integrate a particle using semi implicit euler \end{DoxyCompactList}\item 
void \hyperlink{class_integration_a262b7b62f9d8f179f23abb6443429838}{evaluateLeapfrog} (\hyperlink{class_particle}{Particle} \&io\_\-currentParticle)
\begin{DoxyCompactList}\small\item\em integrate a particle using leapfrog \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hyperlink{_integration_8h_acfa28acdaa41352ffd89be690a20933d}{IntegrationType} \hyperlink{class_integration_ab27c0a93e9c048aca1d3a69f58405f5a}{m\_\-integrationType}
\begin{DoxyCompactList}\small\item\em integration method \end{DoxyCompactList}\item 
ngl::Real \hyperlink{class_integration_ac6fb116da48405aca6f4f32ff2065051}{m\_\-timestep}
\begin{DoxyCompactList}\small\item\em timestep of simulation \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
handles integration to find next position and velocity of particles 

Definition at line 23 of file Integration.h.



\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_integration_a952d2dc5cab80259492e5f17ef9422a5}{
\index{Integration@{Integration}!Integration@{Integration}}
\index{Integration@{Integration}!Integration@{Integration}}
\subsubsection[{Integration}]{\setlength{\rightskip}{0pt plus 5cm}Integration::Integration (
\begin{DoxyParamCaption}
\item[{const {\bf IntegrationType}}]{\_\-integrationType, }
\item[{const ngl::Real}]{\_\-timestep}
\end{DoxyParamCaption}
)}}
\label{class_integration_a952d2dc5cab80259492e5f17ef9422a5}


ctor 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em \_\-integrationType} & the integration method \\
\hline
\mbox{\tt in}  & {\em \_\-timestep} & the timestep of the simulation \\
\hline
\end{DoxyParams}


Definition at line 7 of file Integration.cpp.


\begin{DoxyCode}
{
    m_integrationType = _integrationType;
    m_timestep = _timestep;
}
\end{DoxyCode}


\subsection{Member Function Documentation}
\hypertarget{class_integration_a262b7b62f9d8f179f23abb6443429838}{
\index{Integration@{Integration}!evaluateLeapfrog@{evaluateLeapfrog}}
\index{evaluateLeapfrog@{evaluateLeapfrog}!Integration@{Integration}}
\subsubsection[{evaluateLeapfrog}]{\setlength{\rightskip}{0pt plus 5cm}void Integration::evaluateLeapfrog (
\begin{DoxyParamCaption}
\item[{{\bf Particle} \&}]{io\_\-currentParticle}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{class_integration_a262b7b62f9d8f179f23abb6443429838}


integrate a particle using leapfrog 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em io\_\-currentParticle} & the particle that is being affected \\
\hline
\end{DoxyParams}


Definition at line 36 of file Integration.cpp.



References Particle::getAcceleration(), Particle::getLastAcceleration(), Particle::getPosition(), Particle::getVelocity(), m\_\-timestep, Particle::updatePosition(), and Particle::updateVelocity().


\begin{DoxyCode}
{
    //modified leapfrog from http://en.wikipedia.org/wiki/Leapfrog_integration
    io_currentParticle.updateVelocity(io_currentParticle.getVelocity() + (((io_cu
      rrentParticle.getLastAcceleration() + io_currentParticle.getAcceleration()) / 2.0
      ) * m_timestep));

    io_currentParticle.updatePosition(io_currentParticle.getPosition() + (io_curr
      entParticle.getVelocity() * m_timestep) + ((io_currentParticle.
      getLastAcceleration() / 2.0) * m_timestep * m_timestep));
}
\end{DoxyCode}


Here is the call graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=398pt]{class_integration_a262b7b62f9d8f179f23abb6443429838_cgraph}
\end{center}
\end{figure}




Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_integration_a262b7b62f9d8f179f23abb6443429838_icgraph}
\end{center}
\end{figure}


\hypertarget{class_integration_a26c01fb79df301b5a4b337a0ffc038b6}{
\index{Integration@{Integration}!evaluateSemiImplicitEuler@{evaluateSemiImplicitEuler}}
\index{evaluateSemiImplicitEuler@{evaluateSemiImplicitEuler}!Integration@{Integration}}
\subsubsection[{evaluateSemiImplicitEuler}]{\setlength{\rightskip}{0pt plus 5cm}void Integration::evaluateSemiImplicitEuler (
\begin{DoxyParamCaption}
\item[{{\bf Particle} \&}]{io\_\-currentParticle}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{class_integration_a26c01fb79df301b5a4b337a0ffc038b6}


integrate a particle using semi implicit euler 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em io\_\-currentParticle} & the particle that is being affected \\
\hline
\end{DoxyParams}


Definition at line 28 of file Integration.cpp.



References Particle::getAcceleration(), Particle::getPosition(), Particle::getVelocity(), m\_\-timestep, Particle::updatePosition(), and Particle::updateVelocity().


\begin{DoxyCode}
{
    //semi implicit euler from http://en.wikipedia.org/wiki/Semi-implicit_Euler
    io_currentParticle.updateVelocity(io_currentParticle.getVelocity() + (io_curr
      entParticle.getAcceleration() * m_timestep));

    io_currentParticle.updatePosition(io_currentParticle.getPosition() + (io_curr
      entParticle.getVelocity() * m_timestep));
}
\end{DoxyCode}


Here is the call graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_integration_a26c01fb79df301b5a4b337a0ffc038b6_cgraph}
\end{center}
\end{figure}




Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_integration_a26c01fb79df301b5a4b337a0ffc038b6_icgraph}
\end{center}
\end{figure}


\hypertarget{class_integration_a40b1cb639b068c89db9646fb5022f966}{
\index{Integration@{Integration}!getIntegrationType@{getIntegrationType}}
\index{getIntegrationType@{getIntegrationType}!Integration@{Integration}}
\subsubsection[{getIntegrationType}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IntegrationType} Integration::getIntegrationType (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{class_integration_a40b1cb639b068c89db9646fb5022f966}


get the integration method 



Definition at line 40 of file Integration.h.



References m\_\-integrationType.


\begin{DoxyCode}
{ return m_integrationType; }
\end{DoxyCode}
\hypertarget{class_integration_a16c2c98401d18f3232a2d31df8cf8b62}{
\index{Integration@{Integration}!getTimestep@{getTimestep}}
\index{getTimestep@{getTimestep}!Integration@{Integration}}
\subsubsection[{getTimestep}]{\setlength{\rightskip}{0pt plus 5cm}ngl::Real Integration::getTimestep (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{class_integration_a16c2c98401d18f3232a2d31df8cf8b62}


get the timestep of the simulation 



Definition at line 51 of file Integration.h.



References m\_\-timestep.


\begin{DoxyCode}
{ return m_timestep; }
\end{DoxyCode}


Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=378pt]{class_integration_a16c2c98401d18f3232a2d31df8cf8b62_icgraph}
\end{center}
\end{figure}


\hypertarget{class_integration_abc488c4b587e1f5ef990092692af1b79}{
\index{Integration@{Integration}!integrateNext@{integrateNext}}
\index{integrateNext@{integrateNext}!Integration@{Integration}}
\subsubsection[{integrateNext}]{\setlength{\rightskip}{0pt plus 5cm}void Integration::integrateNext (
\begin{DoxyParamCaption}
\item[{{\bf Particle} \&}]{io\_\-currentParticle}
\end{DoxyParamCaption}
)}}
\label{class_integration_abc488c4b587e1f5ef990092692af1b79}


integrate next velocity and position of a particle 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em io\_\-currentParticle} & the particle that is being affected \\
\hline
\end{DoxyParams}


Definition at line 16 of file Integration.cpp.



References evaluateLeapfrog(), evaluateSemiImplicitEuler(), LEAPFROG, m\_\-integrationType, and SEMI\_\-IMPLICIT\_\-EULER.


\begin{DoxyCode}
{
    //calls user-chosen integrator
    switch (m_integrationType)
    {
        case SEMI_IMPLICIT_EULER: { evaluateSemiImplicitEuler(io_currentParticle)
      ; break; }
        case LEAPFROG: { evaluateLeapfrog(io_currentParticle); break; }

        default : break;
    }
}
\end{DoxyCode}


Here is the call graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_integration_abc488c4b587e1f5ef990092692af1b79_cgraph}
\end{center}
\end{figure}




Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_integration_abc488c4b587e1f5ef990092692af1b79_icgraph}
\end{center}
\end{figure}


\hypertarget{class_integration_af4c8b19403365773f73c9326574ff3dd}{
\index{Integration@{Integration}!setIntegrationType@{setIntegrationType}}
\index{setIntegrationType@{setIntegrationType}!Integration@{Integration}}
\subsubsection[{setIntegrationType}]{\setlength{\rightskip}{0pt plus 5cm}void Integration::setIntegrationType (
\begin{DoxyParamCaption}
\item[{const int}]{\_\-v}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{class_integration_af4c8b19403365773f73c9326574ff3dd}


set the integration method of the simulation 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em \_\-v} & new integration method \\
\hline
\end{DoxyParams}


Definition at line 48 of file Integration.h.



References m\_\-integrationType.


\begin{DoxyCode}
{ m_integrationType = (IntegrationType)_v; }
\end{DoxyCode}
\hypertarget{class_integration_aab0af151cb363f5a2f7453466619631d}{
\index{Integration@{Integration}!setIntegrationType@{setIntegrationType}}
\index{setIntegrationType@{setIntegrationType}!Integration@{Integration}}
\subsubsection[{setIntegrationType}]{\setlength{\rightskip}{0pt plus 5cm}void Integration::setIntegrationType (
\begin{DoxyParamCaption}
\item[{const {\bf IntegrationType}}]{\_\-v}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{class_integration_aab0af151cb363f5a2f7453466619631d}


sets the integration method 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em \_\-v} & the new integration method \\
\hline
\end{DoxyParams}


Definition at line 44 of file Integration.h.



References m\_\-integrationType.


\begin{DoxyCode}
{ m_integrationType = _v; }
\end{DoxyCode}


Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_integration_aab0af151cb363f5a2f7453466619631d_icgraph}
\end{center}
\end{figure}


\hypertarget{class_integration_aa9a9fc72d614bdbbedef54353fc8f2fe}{
\index{Integration@{Integration}!setTimestep@{setTimestep}}
\index{setTimestep@{setTimestep}!Integration@{Integration}}
\subsubsection[{setTimestep}]{\setlength{\rightskip}{0pt plus 5cm}void Integration::setTimestep (
\begin{DoxyParamCaption}
\item[{const ngl::Real}]{\_\-v}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{class_integration_aa9a9fc72d614bdbbedef54353fc8f2fe}


set the timestep of the simulation 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em \_\-v} & new timestep \\
\hline
\end{DoxyParams}


Definition at line 55 of file Integration.h.



References m\_\-timestep.


\begin{DoxyCode}
{ m_timestep = _v; }
\end{DoxyCode}


Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_integration_aa9a9fc72d614bdbbedef54353fc8f2fe_icgraph}
\end{center}
\end{figure}




\subsection{Member Data Documentation}
\hypertarget{class_integration_ab27c0a93e9c048aca1d3a69f58405f5a}{
\index{Integration@{Integration}!m\_\-integrationType@{m\_\-integrationType}}
\index{m\_\-integrationType@{m\_\-integrationType}!Integration@{Integration}}
\subsubsection[{m\_\-integrationType}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IntegrationType} {\bf Integration::m\_\-integrationType}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{class_integration_ab27c0a93e9c048aca1d3a69f58405f5a}


integration method 



Definition at line 60 of file Integration.h.

\hypertarget{class_integration_ac6fb116da48405aca6f4f32ff2065051}{
\index{Integration@{Integration}!m\_\-timestep@{m\_\-timestep}}
\index{m\_\-timestep@{m\_\-timestep}!Integration@{Integration}}
\subsubsection[{m\_\-timestep}]{\setlength{\rightskip}{0pt plus 5cm}ngl::Real {\bf Integration::m\_\-timestep}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{class_integration_ac6fb116da48405aca6f4f32ff2065051}


timestep of simulation 



Definition at line 63 of file Integration.h.



The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
include/\hyperlink{_integration_8h}{Integration.h}\item 
src/\hyperlink{_integration_8cpp}{Integration.cpp}\end{DoxyCompactItemize}
